package com.health.controller.manage;


import com.health.common.R;
import com.health.service.MemberService;
import com.health.service.SetmealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/manage/report")
@Api(tags = "报表管理")
@RequiredArgsConstructor
@Slf4j
public class ReportController {

    private final SetmealService setmealService;
    private final MemberService memberService;

    @GetMapping("/getSetmealReportData")
    @ApiOperation(value = "套餐统计")
    public R getSetmealReportData() {
        log.info("套餐统计");
        List<Map<String, Object>> list = setmealService.getSetmealReportData();
        return R.success(list);
    }

    @GetMapping("/getMemberReportData")
    @ApiOperation(value = "会员统计")
    public R getMemberReportData() {
        log.info("会员统计");
        Map<String, Object> map = memberService.getMemberReportData();
        return R.success(map);
    }

}
